package com.aos.iot.socket.common.protocol;

import com.aos.iot.socket.common.message.Message;
import com.aos.iot.socket.common.parser.DataParser;
import com.aos.iot.socket.common.parser.Parser;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelOutboundHandlerAdapter;

public interface IProtocol<M extends Message> {

    ChannelInboundHandlerAdapter decoder();

    ChannelOutboundHandlerAdapter encoder();

     Parser<M> getParser();

    DataParser getDataParser(String cmd);

    String name();

    default IProtocol<M> protocol() {
        return this;
    }
}
